package com.spotalog.server.service.rest;

import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import javax.xml.bind.JAXBContext;

@Provider
@Singleton
class JaxbContextResolver implements ContextResolver<JAXBContext> {
	private final JAXBContext ctx;

	@Inject
	JaxbContextResolver(JAXBContext ctx) {
		this.ctx = ctx;
	}

	@Override
	public JAXBContext getContext(Class<?> type) {
		return this.ctx;
	}
}
